#include "stdafx.h"
#include "Token.h"


CToken::CToken(){}


CToken::~CToken(){}

std::string CToken::GetTokenValue(TokenNames tokenName, std::string & name)
{
    switch (tokenName)
    {
    case CToken::Class:
        name = "class";
        return std::string("class");
    
    case CToken::Extends:
        name = "extends";
        return std::string("extends");
    
    case CToken::Public:
        name = "public";
        return std::string("public");
    
    case CToken::Static:
        name = "static";
        return std::string("static");
    
    case CToken::Void:
        name = "void";
        return std::string("void");
    
    case CToken::Main:
        name = "main";
        return std::string("main");
    
    case CToken::LBrace:
        name = "left brace";
        return std::string("{");
    
    case CToken::RBrace:
        name = "right brace";
        return std::string("}");
    
    case CToken::LParen:
        name = "left parenthesis";
        return std::string("(");
    
    case CToken::RParen:
        name = "right parenthesis";
        return std::string(")");
    
    case CToken::LBraket:
        name = "left braket";
        return std::string("[");
    
    case CToken::RBraket:
        name = "right braket";
        return std::string("]");
    
    case CToken::True:
        name = "true";
        return std::string("true");
    
    case CToken::False:
        name = "false";
        return std::string("false");
    
    case CToken::Int:
        name = "int";
        return std::string("int");
    
    case CToken::Boolean:
        name = "boolean";
        return std::string("boolean");
    
    case CToken::String:
        name = "String";
        return std::string("String");
    
    case CToken::If:
        name = "if";
        return std::string("if");
    
    case CToken::While:
        name = "while";
        return std::string("while");
    
    case CToken::PrintLn:
        name = "System.out.println";
        return std::string("System.out.println");
    
    case CToken::Return:
        name = "return";
        return std::string("return");
    
    case CToken::Length:
        name = "length";
        return std::string("length");
    
    case CToken::New:
        name = "new";
        return std::string("new");
    
    case CToken::Add:
        name = "add";
        return std::string("+");
    
    case CToken::Sub:
        name = "sub";
        return std::string("-");
    
    case CToken::Mult:
        name = "mult";
        return std::string("*");
    
    case CToken::Less:
        name = "less";
        return std::string("<");
    
    case CToken::And:
        name = "and";
        return std::string("&&");
    
    case CToken::Not:
        name = "not";
        return std::string("!");

    case CToken::Assign:
        name = "assign";
        return std::string("=");

    case CToken::Point:
        name = "point";
        return std::string(".");

    case CToken::Semicolon:
        name = "semicolon";
        return std::string(";");
    
    case CToken::This:
        name = "this";
        return std::string("this");
    default:
        return std::string();
    }
}
